/* 
 * File:   GenericContingencyMatrix.cpp
 * Author: Guilherme Monteiro
 * 
 */

#include "../headers/GenericContingencyMatrix.h"

GenericContingencyMatrix::GenericContingencyMatrix(vector<T> userAnswers, 
            vector<T> softwareOutput) {
    setUserAnswers(userAnswers);
    setSoftwareOutput(softwareOutput);
}

GenericContingencyMatrix::GenericContingencyMatrix(const GenericContingencyMatrix& orig) {
}

GenericContingencyMatrix::~GenericContingencyMatrix() {
}

/**
 * Sets the software output.
 * 
 * @param sotwareOutput
 */
void GenericContingencyMatrix::setSoftwareOutput(vector<T> softwareOutput) {
    this->softwareOutput = softwareOutput;
}

/**
 * Sets the user answers.
 * 
 * @param userAnswers
 */
void GenericContingencyMatrix::setUserAnswers(vector<T> userAnswers) {
    this->userAnswers = userAnswers;
}

/**
 * Return false negative tax.
 * 
 * @return false negative tax.
 */
double GenericContingencyMatrix::getFN() {
    return this->FN;
}

/**
 * Sets false negative tax.
 * 
 * @param FN
 */
void GenericContingencyMatrix::setFN(double FN) {
    this->FN = FN;
}

/**
 * Return false positive tax.
 * 
 * @return false positive tax.
 */
double GenericContingencyMatrix::getFP() {
    return this->FN;
}

/**
 * Sets false positive tax.
 * 
 * @param FP
 */
void GenericContingencyMatrix::setFP(double FP) {
    this->FP = FP;
}

/**
 * Return true positive tax.
 * 
 * @return true positive tax.
 */
double GenericContingencyMatrix::getTP() {
    return this->TP;
}

/**
 * Sets true positive tax.
 * 
 * @param TP
 */
void GenericContingencyMatrix::setTP(double TP) {
    this->TP = TP;
}

/**
 * Return true negative tax.
 * 
 * @return true negative tax.
 */
double GenericContingencyMatrix::getTN() {
    return this->TN;
}

/**
 * Sets true negative tax.
 * 
 * @param TN
 */
void GenericContingencyMatrix::setTN(double TN) {
    this->TN = TN;
}

/**
 * Return false positive rate.
 * 
 * @return false positive rate.
 */
double GenericContingencyMatrix::getFPR() {
    return this->FPR;
}

/**
 * Sets false positive rate.
 * 
 * @param FPR
 */
void GenericContingencyMatrix::setFPR() {
    this->FPR = FP/(FP + TN);
}

/**
 * Return true positive rate.
 * 
 * @return true positive rate.
 */
double GenericContingencyMatrix::getTPR() {
    return this->TPR;
}

/**
 * Sets true positive rate.
 * 
 * @param TPR
 */
void GenericContingencyMatrix::setTPR() {
    this->TPR = TP/(TP + FN);
}
